/******************************************************************************* 
  Copyright (C), 1988-2020, zeno Tech. Co., Ltd.
  Description:   模拟输出画图模块功能接口  
  Function List:     
  History:
    <wumj -- 2015-06-29>  创建
*******************************************************************************/ 
#ifndef VIDEO_COMM_H
#define VIDEO_COMM_H

#ifdef __cplusplus
extern "C" {
#endif

/*=============================================================================
                                 Includes                                  
 =============================================================================*/

/*=============================================================================
                               Macro Definition
 =============================================================================*/ 

/*=============================================================================
                        Local Structures and Typedef 
 =============================================================================*/ 
/* 点坐标 */
typedef struct
{
    int x;
    int y;
}VIDEO_point_t;

/* 线坐标 */ 
typedef struct
{ 
	unsigned int pointNum;
	VIDEO_point_t *pPoints;
}VIDEO_line_t;

/* 多边形坐标 */ 
typedef struct
{
	unsigned int pointNum;
	VIDEO_point_t *pPoints;
}VIDEO_Region_t;

/* 图像分辨率 */ 
typedef struct
{
    unsigned int u32Width;
    unsigned int u32Height;
} VIDEO_picSize_t;

/* sensor类型，新增sensor类型添加到尾部 */
typedef enum
{
    VIDEO_SNS_AR0130   = 0,
    VIDEO_SNS_OV9712   = 1,  
    VIDEO_SNS_IMX122   = 2,
    VIDEO_SNS_IMX222   = 3,
    VIDEO_SNS_IMX138   = 4,
    VIDEO_SNS_SOIH22   = 5,
    VIDEO_SNS_IMX238   = 6,
    VIDEO_SNS_IMX178   = 7,
    VIDEO_SNS_MN34220  = 8,
    VIDEO_SNS_IMX124   = 9,
    VIDEO_SNS_AR0330   = 10,
    VIDEO_SNS_MIS1011  = 11,
    VIDEO_SNS_SOIH42   = 12,
    VIDEO_SNS_OV4689   = 13,
    VIDEO_SNS_IMX322   = 14,
    VIDEO_SNS_PO1210K  = 15,
    VIDEO_SNS_PO4100K  = 16,
    VIDEO_SNS_IMX224   = 17,
    VIDEO_SNS_IMX225   = 18,
    VIDEO_SNS_IMX123   = 19,    
    VIDEO_SNS_IMX185   = 20, 
	VIDEO_SNS_AR0331   = 21,
	VIDEO_BT1120_200W   = 22,
	VIDEO_HI3516D_MN34220 =23,
	VIDEO_BT1120_100W  = 24, 
	VIDEO_SNS_OV2710   = 25,  
	VIDEO_SNS_IMX290   = 26,
	VIDEO_SNS_IMX291   = 27, 
	VIDEO_SNS_SC2035   = 28,
	VIDEO_SNS_SOIF02   = 29, 
    VIDEO_BT1120_130W   = 30,
    VIDEO_SNS_IMX226   = 31,
    VIDEO_SNS_SC1035   = 32,
    VIDEO_SNS_IMX323   = 33,
    VIDEO_SNS_AR0237   = 34,
    VIDEO_SNS_IMX274   = 35,
    VIDEO_SNS_BG0703   = 36,
    VIDEO_SNS_SC1135   = 37,
    VIDEO_SNS_OV2735   = 38,
    VIDEO_SNS_GC2023   = 39,
    VIDEO_SNS_OS05A10  = 40,
    VIDEO_SNS_F22      = 41,
    VIDEO_SNS_IMX385   = 42,
    VIDEO_SNS_AR0521   = 43,
    VIDEO_SNS_OV9732   = 44,
	VIDEO_SNS_PS5510   = 45,
	VIDEO_SNS_IMX327   = 46,
	VIDEO_SNS_IMX307   = 47,
	VIDEO_SNS_IMX334   = 48,
	VIDEO_SNS_SC2235   = 49,
	VIDEO_SNS_PS5260   = 50,
	VIDEO_SNS_PS5280   = 51,
    VIDEO_SNS_OV9750   = 52,
    VIDEO_SNS_GC2063   = 53,
	VIDEO_SNS_OS08A10   = 54,
    VIDEO_SNS_SC2232H   = 55,
    VIDEO_SNS_SC3235    = 56,
    VIDEO_SNS_SC2310    = 57,
    VIDEO_SNS_IMX335_400w = 58,
    VIDEO_SNS_IMX335_500w = 59,
    VIDEO_SNS_OS05A_500w  = 60,
    VIDEO_SNS_IMX377      = 61,
    VIDEO_SNS_IMX415    = 62
} VIDEO_snsType_t;

/* 图像制式，新增图像制式添加到尾部 */
typedef enum
{
    VIDEO_STANDARD_PAL,  
    VIDEO_STANDARD_NTSC,
    VIDEO_STANDARD_INVALID,
} VIDEO_standard_t;

/* 分辨率，新增分辨率添加到尾部 */
typedef enum
{
    VIDEO_RESOLUTION_QCIF   = 0,
    VIDEO_RESOLUTION_CIF    = 1,
    VIDEO_RESOLUTION_D1     = 2,
    VIDEO_RESOLUTION_960H   = 3,
    VIDEO_RESOLUTION_2CIF   = 4,
    VIDEO_RESOLUTION_QVGA   = 5,
    VIDEO_RESOLUTION_VGA    = 6,
    VIDEO_RESOLUTION_XGA    = 7,
    VIDEO_RESOLUTION_SXGA   = 8,
    VIDEO_RESOLUTION_UXGA   = 9,
    VIDEO_RESOLUTION_QXGA   = 10,
    VIDEO_RESOLUTION_WVGA   = 11,
    VIDEO_RESOLUTION_WSXGA  = 12,
    VIDEO_RESOLUTION_WUXGA  = 13,
    VIDEO_RESOLUTION_WQXGA  = 14,
    VIDEO_RESOLUTION_H1080  = 15,
    VIDEO_RESOLUTION_H720   = 16, 
    VIDEO_RESOLUTION_H960   = 17,  
    VIDEO_RESOLUTION_H1024  = 18,
    VIDEO_RESOLUTION_H1920  = 19,
    VIDEO_RESOLUTION_H1536  = 20,
    VIDEO_RESOLUTION_H1520  = 21,
    VIDEO_RESOLUTION_4M     = 22,
    VIDEO_RESOLUTION_2560_1440  = 23,
    VIDEO_RESOLUTION_2304_1296  = 24,
    VIDEO_RESOLUTION_ALG4_3  = 25,        /* 智能算法专用的4:3分辨率 */
    VIDEO_RESOLUTION_ALG16_9 = 26,        /* 智能算法专用的16:9分辨率 */
    VIDEO_RESOLUTION_1536_1536 = 27,
    VIDEO_RESOLUTION_STD_D1 = 28,
    VIDEO_RESOLUTION_2592_1944 = 29,
    VIDEO_RESOLUTION_4096_2160 = 31,
    VIDEO_RESOLUTION_3840_2160 = 32,
    VIDEO_RESOLUTION_4000_3000 = 33,
	VIDEO_RESOLUTION_1792_980 = 34,
	VIDEO_RESOLUTION_1792_1080 = 35,
	VIDEO_RESOLUTION_640_360 = 36,
	VIDEO_RESOLUTION_960_540 = 37,
} VIDEO_resolution_t; 

/* 宽动态模式 */
typedef enum
{
    VIDEO_WDR_MODE_NONE = 0, 
    VIDEO_WDR_MODE_BUILT_IN,    
    VIDEO_WDR_MODE_2To1_LINE,
    VIDEO_WDR_MODE_2To1_FRAME,
    VIDEO_WDR_MODE_2To1_FRAME_FULL_RATE,
    VIDEO_WDR_MODE_3To1_LINE,
    VIDEO_WDR_MODE_3To1_FRAME,
    VIDEO_WDR_MODE_3To1_FRAME_FULL_RATE,
    VIDEO_WDR_MODE_4To1_LINE,
    VIDEO_WDR_MODE_4To1_FRAME,
    VIDEO_WDR_MODE_4To1_FRAME_FULL_RATE,
    VIDEO_WDR_MODE_BUTT,
} VIDEO_wdrMode; 


/* 镜头信息 */
typedef struct
{
	char name[32];            /* 镜头名 */
	int irisOpType;           /* 光圈操作模式,定义见VideoIrisMode */
	int afOpType;             /* 聚焦操作模式,定义见VideoInFocusMode */
	int afLitNum;             /* 聚焦限位种类 */
	unsigned int afLit[16];   /* distance 距离数组，每一种距离用一个uint表示，
							     单位：mm, 0表示无穷远 */
}VIDEO_lenInfo_t;


/*=============================================================================
                             Extern Variables                                  
=============================================================================*/

/*=============================================================================
                             Local Variables                                  
 =============================================================================*/

/*=============================================================================
                             Function Definition                                  
 =============================================================================*/
/*******************************************************************************
  Function:     VIDEO_GetPicSize
  Description:  根据图像分辨率获取图像尺寸
  Input:        - standard: 制度
                - resolution: 图像分辨率
                - bRotate: 是否旋转
  Output:       - pPicSize: 图像尺寸
  Return:       0: 操作成功
                -1: 操作失败
  Others:       无
*******************************************************************************/
int VIDEO_GetPicSize(VIDEO_standard_t standard, 
                     VIDEO_resolution_t resolution, 
                     VIDEO_picSize_t *pPicSize,
                     int bRotate);


#ifdef __cplusplus
}
#endif

#endif /* VIDEO_COMM_H */
